#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<memory.h>
//int memcmp ( const void * ptr1, const void* ptr2, size_t num );
int my_memcmp(const void* ptr1, const void* ptr2, size_t count)
{
	while (count--)
	{
		if (*(char*)ptr1 > *(char*)ptr2)
		{
			return 1;
		}
		else if (*(char*)ptr1 < *(char*)ptr2)
		{
			return -1;
		}
		else
		{
			ptr1 = (char*)ptr1 + 1;
			ptr2 = (char*)ptr2 + 1;
		}
	}
	return 0;
}
int main()
{
	int arr1[] = { 1,2,3,4,5 };
	int arr2[] = { 1,2,3,4,0x11223305 };
	//int ret = memcmp(arr1, arr2, 17);
	int ret = my_memcmp(arr1, arr2, 17);
	printf("%d\n", ret);
}